//
//  UINavigationController+WSMallitem.m
//  WSMallBuyer
//
//  Created by 王璞 on 2017/12/11.
//  Copyright © 2017年 hedong. All rights reserved.
//

#import "UINavigationController+WSMallitem.h"

@implementation UINavigationController (WSMallitem)
- (void)setLeftBtnWithTarget:(id)target action:(SEL)action
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = CGRectMake(0,0,45,45);
    [btn setImage:[UIImage imageNamed:@"Back"] forState:UIControlStateNormal];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    self.visibleViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:btn];
}
- (void)back:(UIButton*)sender{
    [self popViewControllerAnimated:YES];
}
@end
